Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ai-goal refactor #6467

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Ai-goal refactor #6467

merged 3 commits into from
Jan 11, 2025

Conversation

Goober5000
Copy link
Contributor

@Goober5000 Goober5000 commented Dec 16, 2024

Refactor the list of AI goals to be a list of enums, not a list of bit flags. This will allow additional goal types to be added above the current limit. The refactor involves removing all bitfield comparisons from goal modes, which was mostly done as part of WMC's ship type overhaul, but several comparisons still remained, especially in FRED and qtFRED.

Some type safety has also been added, especially to ai_goal_type. Ideally ai_goal_mode would be enum class, but that would be a very large change due to the need to add scoping to all AI_GOAL_* tokens.

In draft pending testing. Fixing #6466 will be a prerequisite to finish testing this PR, as both FRED and qtFRED are affected by the change in goal comparison.

EDIT: see also #4306 which was a similar case of a bitfield being converted to use more than 32 values.

@Goober5000 Goober5000 added qtfred A feature or issue related to qtFred. ai A feature or issue related to the AI algorithms fred A feature or issue related to the FReespace EDitor (FRED) refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability labels Dec 16, 2024
@Goober5000 Goober5000 force-pushed the ai_goal_refactor branch 10 times, most recently from 487f66d to 6fa2d24 Compare December 17, 2024 03:02
@Goober5000
Copy link
Contributor Author

With #6466 fixed, this is now ready for review.

@Goober5000 Goober5000 marked this pull request as ready for review January 9, 2025 19:53
Copy link
Member

@wookieejedi wookieejedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had previously looked over and tested, and once again review and tested and everything looks good to me and works as expected.

@Goober5000 Goober5000 merged commit a214186 into scp-fs2open:master Jan 11, 2025
16 checks passed
@Goober5000 Goober5000 deleted the ai_goal_refactor branch January 11, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai A feature or issue related to the AI algorithms fred A feature or issue related to the FReespace EDitor (FRED) qtfred A feature or issue related to qtFred. refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants